//
//  PTStuLSMissionDetailInfoCell.m
//  PlanTech
//
//  Created by ruifeng song on 2018/7/23.
//  Copyright © 2018年  androidlongs. All rights reserved.
//

#import "PTStuLSMissionDetailInfoCell.h"

@implementation PTStuLSMissionDetailInfoCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
}

-(void)updateMissionDetailInfoCellWith:(LifeServiceMissionDetailModel *)missionDetailModel
{
    if (missionDetailModel == nil) {
        return;
    }
    
    NSString * serviceContentStr = @"";
    NSString * userAddressStr = @"";
    NSString * serviceName = @"";
    NSString * serviceAddress = @"";
    
    if ([missionDetailModel.type integerValue] ==PTLifeService_ExpressType ) {
        
        serviceContentStr = @"快递点：";
        userAddressStr = @"取货码：";
        serviceName = missionDetailModel.destinationAddress;
        if (missionDetailModel.accessCode == nil) {
            missionDetailModel.accessCode = @"";
        }
        serviceAddress = [NSString stringWithFormat:@"%@", missionDetailModel.accessCode];
    }else if ([missionDetailModel.type integerValue] ==PTLifeService_PrintType)
    {
        serviceContentStr = @"打印份数：";
        userAddressStr = @"打印地点：";
        if (missionDetailModel.copies ==nil) {
            missionDetailModel.copies = [NSNumber numberWithInteger:0];
        }
        serviceName = [NSString stringWithFormat:@"%@",missionDetailModel.copies];
        serviceAddress = missionDetailModel.destinationAddress;
    }
    else if ([missionDetailModel.type integerValue] ==PTLifeService_BuyMealType)
    {
        serviceContentStr = @"餐厅名称：";
        userAddressStr = @"餐厅地址：";
        serviceName = missionDetailModel.destinationName;
        serviceAddress = missionDetailModel.destinationAddress;
    }
    else if ([missionDetailModel.type integerValue] ==PTLifeService_HotboomType)
    {
        serviceContentStr = @"超市名称：";
        userAddressStr = @"超市地点：";
        serviceName = missionDetailModel.destinationName;
        serviceAddress = missionDetailModel.destinationAddress;
    }

    self.serviceContentLabel1.text = [NSString stringWithFormat:@"%@%@",serviceContentStr,serviceName];
    
    self.serviceContentLabel2.text = [NSString stringWithFormat:@"%@%@",userAddressStr,serviceAddress];
    
    self.rewardLabel.text =[NSString stringWithFormat:@"酬金：%@RMB",missionDetailModel.reward];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
